using System.Collections.Generic;
using System;
namespace Gltf
{
    public class AccessorSpec : NamedObject
    {
        public static string TypeName = "Accessor";

        public struct ComponentType
        {
            public const int BYTE = 5120;

            public const int UNSIGNED_BYTE = 5121;

            public const int SHORT = 5122;

            public const int UNSIGNED_SHORT = 5123;

            public const int UNSIGNED_INT = 5125;

            public const int FLOAT = 5126;
        };

        public struct Type
        {
            public static string SCALAR = "SCALAR";

            public static string VEC2 = "VEC2";

            public static string VEC3 = "VEC3";

            public static string VEC4 = "VEC4";

            public static string MAT2 = "MAT2";

            public static string MAT3 = "MAT3";

            public static string MAT4 = "MAT4";
        };

        /**
         * @brief The index of the bufferView.
         *
         * The index of the buffer view. When undefined, the accessor **MUST** be
         * initialized with zeros; `sparse` property or extensions **MAY** override
         * zeros with actual values.
         */
        public int bufferView = -1;

        /**
         * @brief The offset relative to the start of the buffer view in bytes.
         *
         * This **MUST** be a multiple of the size of the component datatype. This
         * property **MUST NOT** be defined when `bufferView` is undefined.
         */
        public Int64 byteOffset = 0;

        /**
         * @brief The datatype of the accessor's components.
         *
         * Known values are defined in {@link ComponentType}.
         *
         *
         * UNSIGNED_INT type **MUST NOT** be used for any accessor that is not
         * referenced by `mesh.primitive.indices`.
         */
        public int componentType = ComponentType.BYTE;

        /**
         * @brief Specifies whether integer data values are normalized before usage.
         *
         * Specifies whether integer data values are normalized (`true`) to [0, 1]
         * (for unsigned types) or to [-1, 1] (for signed types) when they are
         * accessed. This property **MUST NOT** be set to `true` for accessors with
         * `FLOAT` or `UNSIGNED_INT` component type.
         */
        public bool normalized = false;

        /**
         * @brief The number of elements referenced by this accessor.
         *
         * The number of elements referenced by this accessor, not to be confused with
         * the number of bytes or number of components.
         */
        public Int64 count;

        /**
         * @brief Specifies if the accessor's elements are scalars, vectors, or
         * matrices.
         *
         * Known values are defined in {@link Type}.
         *
         */
        public string type = Type.SCALAR;

        /**
         * @brief Maximum value of each component in this accessor.
         *
         * Array elements **MUST** be treated as having the same data type as
         * accessor's `componentType`. Both `min` and `max` arrays have the same
         * length.  The length is determined by the value of the `type` property; it
         * can be 1, 2, 3, 4, 9, or 16.
         *
         * `normalized` property has no effect on array values: they always correspond
         * to the actual values stored in the buffer. When the accessor is sparse,
         * this property **MUST** contain maximum values of accessor data with sparse
         * substitution applied.
         */
        public List<double> max = new List<double>();

        /**
         * @brief Minimum value of each component in this accessor.
         *
         * Array elements **MUST** be treated as having the same data type as
         * accessor's `componentType`. Both `min` and `max` arrays have the same
         * length.  The length is determined by the value of the `type` property; it
         * can be 1, 2, 3, 4, 9, or 16.
         *
         * `normalized` property has no effect on array values: they always correspond
         * to the actual values stored in the buffer. When the accessor is sparse,
         * this property **MUST** contain minimum values of accessor data with sparse
         * substitution applied.
         */
        public List<double> min = new List<double>();

        /**
         * @brief Sparse storage of elements that deviate from their initialization
         * value.
         */
        public AccessorSparse? sparse;

    }
}